* %%%%%%%%%%%%%%%%%%%%%%%
*    Plotting Trends-Revision 
*        9/10/21
* %%%%%%%%%%%%%%%%%%%%%%%%


use "AdsEmploymentMerged.dta", clear  


* %%%% Plotting a regression of traits over time %%%%% 
cap drop d1 d2 d3 d4 d5
tab year, gen(d)   //this prevents 1980 from being dropped
la var d1 "1980"
la var d2 "1985"
la var d3 "1990"
la var d4 "1995"
la var d5 "2000"

* %%% Own traits %%%
* %%% Figure 1 %%%

* Education 
estimates clear

reg anyeducself d1 d2 d3 d4 d5 if askermale==1, nocons 
estimates store k1

reg anyeducself d1 d2 d3 d4 d5 if askermale==0, nocons 
estimates store k2

coefplot (k1, mlcolor(black) recast(rscatter) ciopts(recast(rcap) color(black))) /// 
 (k2, mlcolor(gray) mfcolor(gray) recast(rscatter) ciopts(recast(rcap) color(gray))), vertical ///
legend (order(2 "Male" 4 "Female")) xtitle("Year", size(medsmall))   ///
ytitle("Any Education Self") graphregion(color(white))  ylabel(0(0.1)1)


* Occupation
estimates clear
reg anyoccself d1 d2 d3 d4 d5 if askermale==1, nocons 
estimates store k1

reg anyoccself d1 d2 d3 d4 d5 if askermale==0, nocons 
estimates store k2

coefplot (k1, mlcolor(black) recast(rscatter) ciopts(recast(rcap) color(black))) /// 
 (k2, mlcolor(gray) mfcolor(gray) recast(rscatter) ciopts(recast(rcap) color(gray))) , vertical ///
legend (order(2 "Male" 4 "Female")) xtitle("Year", size(medsmall))   ///
ytitle("Any Occupation Self") graphregion(color(white)) ylabel(0(0.1)1)


* Looks
estimates clear
reg anylooksself d1 d2 d3 d4 d5 if askermale==1, nocons 
estimates store k1

reg anylooksself d1 d2 d3 d4 d5 if askermale==0, nocons 
estimates store k2

coefplot (k1, mlcolor(black) recast(rscatter) ciopts(recast(rcap) color(black))) /// 
 (k2, mlcolor(gray) mfcolor(gray) recast(rscatter) ciopts(recast(rcap) color(gray))) , vertical ///
legend (order(2 "Male" 4 "Female")) xtitle("Year", size(medsmall))   ///
ytitle("Any Looks Self") graphregion(color(white))  ylabel(0(0.1)1)


* Ethnicity
estimates clear
reg anyethnicityself d1 d2 d3 d4 d5 if askermale==1, nocons 
estimates store k1

reg anyethnicityself d1 d2 d3 d4 d5 if askermale==0, nocons 
estimates store k2

coefplot (k1, mlcolor(black) recast(rscatter) ciopts(recast(rcap) color(black))) /// 
 (k2, mlcolor(gray) mfcolor(gray) recast(rscatter) ciopts(recast(rcap) color(gray))) , vertical ///
legend (order(2 "Male" 4 "Female")) xtitle("Year", size(medsmall))   ///
ytitle("Any Ethnicity Self") graphregion(color(white)) ylabel(0(0.1)1)



* %%%%%%%%%% Wanted Traits %%%%%%%%%%
* %%%%%%%% Figure 2 %%%%%%%%

* Education 
estimates clear
reg anyeducwanted d1 d2 d3 d4 d5 if askermale==1, nocons 
estimates store k1

reg anyeducwanted d1 d2 d3 d4 d5 if askermale==0, nocons 
estimates store k2

coefplot (k1, mlcolor(black) recast(rscatter) ciopts(recast(rcap) color(black))) /// 
 (k2, mlcolor(gray) mfcolor(gray) recast(rscatter) ciopts(recast(rcap) color(gray))) , vertical ///
legend (order(2 "Male" 4 "Female")) xtitle("Year", size(medsmall))   ///
ytitle("Any Education Wanted") graphregion(color(white)) ylabel(0(0.1)1)


* Occupation
estimates clear
reg anyoccwanted d1 d2 d3 d4 d5 if askermale==1, nocons 
estimates store k1

reg anyoccwanted d1 d2 d3 d4 d5 if askermale==0, nocons 
estimates store k2

coefplot (k1, mlcolor(black) recast(rscatter) ciopts(recast(rcap) color(black))) /// 
 (k2, mlcolor(gray) mfcolor(gray) recast(rscatter) ciopts(recast(rcap) color(gray))) , vertical ///
legend (order(2 "Male" 4 "Female")) xtitle("Year", size(medsmall))   ///
ytitle("Any Occupation Waned") graphregion(color(white)) ylabel(0(0.1)1)



* Looks
estimates clear
reg anylookswanted d1 d2 d3 d4 d5 if askermale==1, nocons 
estimates store k1

reg anylookswanted d1 d2 d3 d4 d5 if askermale==0, nocons 
estimates store k2

coefplot (k1, mlcolor(black) recast(rscatter) ciopts(recast(rcap) color(black))) /// 
 (k2, mlcolor(gray) mfcolor(gray) recast(rscatter) ciopts(recast(rcap) color(gray))) , vertical ///
legend (order(2 "Male" 4 "Female")) xtitle("Year", size(medsmall))   ///
ytitle("Any Looks Wanted") graphregion(color(white))  ylabel(0(0.1)1)


* Ethnicity
estimates clear
reg anyethnicitywanted d1 d2 d3 d4 d5 if askermale==1, nocons 
estimates store k1

reg anyethnicitywanted d1 d2 d3 d4 d5 if askermale==0, nocons 
estimates store k2

coefplot (k1, mlcolor(black) recast(rscatter) ciopts(recast(rcap) color(black))) /// 
 (k2, mlcolor(gray) mfcolor(gray) recast(rscatter) ciopts(recast(rcap) color(gray))) , vertical ///
legend (order(2 "Male" 4 "Female")) xtitle("Year", size(medsmall))   ///
ytitle("Any Ethnicity Wanted") graphregion(color(white)) ylabel(0(0.1)1)


* %%%%%%% Gender norms, By Age %%%%%%%
* %%%%%%% Figure A2 %%%%%%%

* Occupation
estimates clear
reg anyoccwanted d1 d2 d3 d4 d5 if askermale==0 & asker_age<=30, nocons 
estimates store k1

reg anyoccwanted d1 d2 d3 d4 d5 if askermale==0 & asker_age>30, nocons 
estimates store k2

coefplot (k1, mlcolor(black) recast(rscatter) ciopts(recast(rcap) color(black))) /// 
 (k2, mlcolor(gray) mfcolor(gray) recast(rscatter) ciopts(recast(rcap) color(gray))) ///
 , vertical ylabel(0(0.1)1) ///
legend (order(2 "Age<=30" 4 "Age>30")) xtitle("Year", size(medsmall))   ///
ytitle("Any Occupation Wanted") graphregion(color(white))

graph export 

estimates clear
reg anyoccwanted d1 d2 d3 d4 d5 if askermale==1 & asker_age<=30, nocons 
estimates store k1

reg anyoccwanted d1 d2 d3 d4 d5 if askermale==1 & asker_age>30, nocons 
estimates store k2

coefplot (k1, mlcolor(black) recast(rscatter) ciopts(recast(rcap) color(black))) /// 
 (k2, mlcolor(gray) mfcolor(gray) recast(rscatter) ciopts(recast(rcap) color(gray))) ///
 , vertical ylabel(0(0.1)1) ///
legend (order(2 "Age<=30" 4 "Age>30")) xtitle("Year", size(medsmall))   ///
ytitle("Any Occupation Wanted") graphregion(color(white))

graph export

* Looks
estimates clear
reg anylookswanted d1 d2 d3 d4 d5 if askermale==0 & asker_age<=30, nocons 
estimates store k1

reg anylookswanted d1 d2 d3 d4 d5 if askermale==0 & asker_age>30, nocons 
estimates store k2

coefplot (k1, mlcolor(black) recast(rscatter) ciopts(recast(rcap) color(black))) /// 
 (k2, mlcolor(gray) mfcolor(gray) recast(rscatter) ciopts(recast(rcap) color(gray))) ///
 , vertical ylabel(0(0.1)1) ///
legend (order(2 "Age<=30" 4 "Age>30")) xtitle("Year", size(medsmall))   ///
ytitle("Any Looks Wanted") graphregion(color(white))

graph export 

estimates clear
reg anylookswanted d1 d2 d3 d4 d5 if askermale==1 & asker_age<=30, nocons 
estimates store k1

reg anylookswanted d1 d2 d3 d4 d5 if askermale==1 & asker_age>30, nocons 
estimates store k2

coefplot (k1, mlcolor(black) recast(rscatter) ciopts(recast(rcap) color(black))) /// 
 (k2, mlcolor(gray) mfcolor(gray) recast(rscatter) ciopts(recast(rcap) color(gray))) ///
 , vertical ylabel(0(0.1)1) ///
legend (order(2 "Age<=30" 4 "Age>30"))  xtitle("Year", size(medsmall))   ///
ytitle("Any Looks Wanted") graphregion(color(white))


graph export  

* %%%% Gender norms comparing men and women at ages %%%%%
* %%%% Figure A2 %%%%%

* Occupation
estimates clear
reg anyoccwanted d1 d2 d3 d4 d5 if askermale==0 & asker_age<=30, nocons 
estimates store k1

reg anyoccwanted d1 d2 d3 d4 d5 if askermale==1 & asker_age<=30, nocons 
estimates store k2

coefplot (k1, mlcolor(black) recast(rscatter) ciopts(recast(rcap) color(black))) /// 
 (k2, mlcolor(gray) mfcolor(gray) recast(rscatter) ciopts(recast(rcap) color(gray))) ///
 , vertical ylabel(0(0.1)1) ///
legend (order(2 "Female" 4 "Male")) xtitle("Year", size(medsmall))   ///
ytitle("Any Occupation Wanted") graphregion(color(white))

graph export 

estimates clear
reg anyoccwanted d1 d2 d3 d4 d5 if askermale==0 & asker_age>30, nocons 
estimates store k1

reg anyoccwanted d1 d2 d3 d4 d5 if askermale==1 & asker_age>30, nocons 
estimates store k2

coefplot (k1, mlcolor(black) recast(rscatter) ciopts(recast(rcap) color(black))) /// 
 (k2, mlcolor(gray) mfcolor(gray) recast(rscatter) ciopts(recast(rcap) color(gray))) ///
 , vertical ylabel(0(0.1)1) ///
legend (order(2 "Female" 4 "Male")) xtitle("Year", size(medsmall))   ///
ytitle("Any Occupation Wanted") graphregion(color(white))

graph export 


* Looks
estimates clear
reg anylookswanted d1 d2 d3 d4 d5 if askermale==0 & asker_age<=30, nocons 
estimates store k1

reg anylookswanted d1 d2 d3 d4 d5 if askermale==1 & asker_age<=30, nocons 
estimates store k2

coefplot (k1, mlcolor(black) recast(rscatter) ciopts(recast(rcap) color(black))) /// 
 (k2, mlcolor(gray) mfcolor(gray) recast(rscatter) ciopts(recast(rcap) color(gray))) ///
 , vertical ylabel(0(0.1)1) ///
legend (order(2 "Female" 4 "Male")) xtitle("Year", size(medsmall))   ///
ytitle("Any Looks Wanted") graphregion(color(white))

graph export 


estimates clear
reg anylookswanted d1 d2 d3 d4 d5 if askermale==0 & asker_age>30, nocons 
estimates store k1

reg anylookswanted d1 d2 d3 d4 d5 if askermale==1 & asker_age>30, nocons 
estimates store k2

coefplot (k1, mlcolor(black) recast(rscatter) ciopts(recast(rcap) color(black))) /// 
 (k2, mlcolor(gray) mfcolor(gray) recast(rscatter) ciopts(recast(rcap) color(gray))) ///
 , vertical ylabel(0(0.1)1) ///
legend (order(2 "Female" 4 "Male")) xtitle("Year", size(medsmall))   ///
ytitle("Any Looks Wanted") graphregion(color(white))

graph export 


* %%%%% Wanted by Age %%%%%%%
* %%%%%%%% Figure A3 %%%%%%%%%
* By Age Group	
cap drop yscat
egen yscat= cut(asker_age), group(10) label
table asker_age yscat

cap drop agr*
gen agr1=1 if asker_age>=17 & asker_age<=22
gen agr2=1 if asker_age>=23 & asker_age<=24
gen agr3=1 if asker_age>=25 & asker_age<=25
gen agr4=1 if asker_age>=26 & asker_age<=27
gen agr5=1 if asker_age>=28 & asker_age<=28
gen agr6=1 if asker_age>=29 & asker_age<=29
gen agr7=1 if asker_age>=30 & asker_age<=31
gen agr8=1 if asker_age>=32 & asker_age<=34
gen agr9=1 if asker_age>=35 & asker_age<=39
gen agr10=1 if asker_age>=40 

for varlist agr1-agr10: replace X=0 if X==. & asker_age~=.

la var agr1 "17-22"
la var agr2 "23-24"
la var agr3 "25-25"
la var agr4 "26-27"
la var agr5 "28-28"
la var agr6 "29-29"
la var agr7 "30-31"
la var agr8 "32-34"
la var agr9 "35-39"
la var agr10 "40-60"

* Number of demands
estimates clear
reg  numdem agr1-agr10 if askermale==1, nocons 
estimates store k1

reg numdem agr1-agr10 if askermale==0 , nocons 
estimates store k2

coefplot (k1, mlcolor(black) recast(rscatter) ciopts(recast(rcap) color(black))) /// 
 (k2, mlcolor(gray) mfcolor(gray) recast(rscatter) ciopts(recast(rcap) color(gray))) ///
, vertical ylabel(0(1)4) ///
legend (order(2 "Male" 4 "Female")) xtitle("Date", size(medsmall))   ///
ytitle("Number of Demands") graphregion(color(white))

graph export 

* Education wanted 
estimates clear
reg anyeducwanted agr1-agr10 if askermale==1, nocons 
estimates store k1

reg anyeducwanted agr1-agr10 if askermale==0, nocons 
estimates store k2

coefplot (k1, mlcolor(black) recast(rscatter) ciopts(recast(rcap) color(black))) /// 
 (k2, mlcolor(gray) mfcolor(gray) recast(rscatter) ciopts(recast(rcap) color(gray))) ///
, vertical ylabel(0(0.1)1) ///
legend (order(2 "Male" 4 "Female")) xtitle("Date", size(medsmall))   ///
ytitle("Any Educated Wanted") graphregion(color(white))

graph export 


* Looks wanted 
estimates clear
reg anylookswanted agr1-agr10 if askermale==1, nocons 
estimates store k1

reg anylookswanted agr1-agr10 if askermale==0, nocons 
estimates store k2

coefplot (k1, mlcolor(black) recast(rscatter) ciopts(recast(rcap) color(black))) /// 
 (k2, mlcolor(gray) mfcolor(gray) recast(rscatter) ciopts(recast(rcap) color(gray))) ///
, vertical ylabel(0(0.1)1) ///
legend (order(2 "Male" 4 "Female")) xtitle("Date", size(medsmall))   ///
ytitle("Any Looks Wanted") graphregion(color(white))

graph export

* Occupation wanted 
estimates clear
reg anyoccwanted agr1-agr10 if askermale==1, nocons 
estimates store k1

reg anyoccwanted agr1-agr10 if askermale==0, nocons 
estimates store k2

coefplot (k1, mlcolor(black) recast(rscatter) ciopts(recast(rcap) color(black))) /// 
 (k2, mlcolor(gray) mfcolor(gray) recast(rscatter) ciopts(recast(rcap) color(gray))) ///
, vertical  ylabel(0(0.1)1)   ///
legend (order(2 "Male" 4 "Female")) xtitle("Date", size(medsmall))   ///
ytitle("Any Occupation Wanted") graphregion(color(white))

graph export 

